Add cadence to XCSV.
authorrobertl <robertl>
Sat, 7 Oct 2006 23:38:39 +0000 (23:38 +0000)
committerrobertl <robertl>
Sat, 7 Oct 2006 23:38:39 +0000 (23:38 +0000)
csv_util.c

index 3b0b907ea025dbd84f03805b98cbb6d544b21b9f..e0817d44c6ffee6be0c4a56239c4331aa63b23ff 100644 (file)
@@ -980,6 +980,9 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
     if ( strcmp( fmp->key, "HEART_RATE") == 0) {
       wpt->heartrate = atoi(s); 
     } else
+    if ( strcmp( fmp->key, "CADENCE") == 0) {
+      wpt->cadence = atoi(s); 
+    } else
     if ( strcmp( fmp->key, "PATH_DISTANCE_KM") == 0 ) {
        /* Ignored on input */
     } else {
@@ -1330,6 +1333,10 @@ xcsv_waypt_pr(const waypoint *wpt)
         if (strcmp(fmp->key, "HEART_RATE") == 0) {
             writebuff(buff, fmp->printfc, wpt->heartrate);
         } else
+        /* CADENCE CONVERSION***********************************************/
+        if (strcmp(fmp->key, "CADENCE") == 0) {
+            writebuff(buff, fmp->printfc, wpt->cadence);
+        } else
         /* TIME CONVERSIONS**************************************************/
         if (strcmp(fmp->key, "EXCEL_TIME") == 0) {
             /* creation time as an excel (double) time */